﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Omix.Dynamic.Common;

namespace Omix.Dynamic.Data
{
    public class TableInfo
    {
        public string Schema { get; set; }
        public string Name { get; set; }

        public List<ColumnInfo> Columns { get; set; }

        public string VariableName
        {
            get
            {
                if (string.IsNullOrEmpty(Schema) || Schema == "dbo")
                {
                    return Name;
                }
                else
                {
                    return string.Format("{0}_{1}", Schema, Name);
                }
            }
        }

        //XML Extended Properties
        public string TableProperties { get; set; }


        public TableInfo()
        {
            Columns = new List<ColumnInfo>();
        }

        public override string ToString()
        {
            return VariableName;
        }
    }
}
